#pragma once
#include <iostream>
#include <string>
#include <iomanip>
#include <sstream>
#include <vector>



using namespace std;

	class Student
	{
	protected:

			string firstName;
			string lastName;
			int enrollmentYear;
			

	public:

		Student(void) : firstName(""), lastName(""), enrollmentYear(0){}
		Student(string firstName, string lastName, int enrollmentYear) 
		{
			this->firstName = firstName;
			this->lastName = lastName;
			this->enrollmentYear = enrollmentYear;
		}
	

		~Student(void)
		{
		}

		string GetFirstName(){return firstName;}
		void SetFirstName(string firstName){this->firstName = firstName;}

		string GetLastName(){return lastName;}
		void SetLastName(string lastName){this->lastName = lastName;}

		int GetEnrollment(){return enrollmentYear;}
		void SetEnrollment(int enrollmentYear){this->enrollmentYear = enrollmentYear;}

		void Read()
		{
			cout <<"Student Info" << endl;
			cout <<"FirstName: " << firstName << endl;
			cout <<"LastName: " << lastName << endl;
			cout <<"Enrolled: " << enrollmentYear << endl << endl;
		}

		void Write()
		{
			cout << "Add Student Info" << endl;
			cout << "Firstname = " ;
			getline(cin, firstName);
			cout << "Lastname = " ;
			getline(cin,lastName);
			cout << "Enrollment Year = ";
			cin >> enrollmentYear;
		}

		friend ostream& operator<<(ostream& out, const Student& student)
		{
			out << "(" << student.firstName << "," << student.lastName << "," << student.enrollmentYear << ")";
			return out;
		}

		friend istream& operator>>(istream& in, Student& student)
		{
			string s;
		
			std::getline(in,s,'(');
			std::getline(in,student.firstName, ',');
			std::getline(in, student.lastName, ',');
			in >> student.enrollmentYear;
			std::getline(in,s,')');
			return in;
		}

	};

